import { hyRequest2 } from "..";

hyRequest2.request({
  url: "/entire/list",
  params: {
    offset: 0,
    size: 20
  }
}).then(res => {
  console.log(res)
})

new Promise<string>((resolve, reject) => {
  resolve("哈哈哈")
}).then(res => {
  console.log(res.length)
})

// 针对单独的请求设置拦截器
hyRequest2.request({
  url: "/home/highscore",
  interceptors: {
    requestSuccessFn: (config) => {
      console.log("/home/highscore请求成功的拦截")
      return config
    },
    responseSuccessFn: (res) => {
      console.log("/home/highscore响应成功的拦截")
      return res
    }
  }
}).then(res => {
  console.log(res)
})